package com.feri.openapi.dao;

import com.feri.openapi.entity.Sms;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface SmsDao {

    //新增
    @Insert("insert into t_sms(recphone,msg,ctime,flag)values(#{recphone},#{msg},now(),#{flag})")
    int insert(Sms sms);
    //查询
    @Select("select * from t_sms order by ctime desc")
    List<Sms>selectAll();
    //查询某个手机号 短信记录
    @Select("select * from t_sms where recphone=#{phone}")
    List<Sms> queryByPhone(String phone);
}
